<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition xmlns="http://www.w3.org/1999/xhtml"  
                xmlns:h="http://java.sun.com/jsf/html"  
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./../templates/FoodSageTemplate.xhtml">

    <ui:define name="logout">
        <p:commandLink id="logoutLink" actionListener="#{touristLogoutManagedBean.doLogout}" value="#{bundle['login.logout.label']}" ajax="false" immediate="true" />
    </ui:define>

    <ui:define name="main_menu">
        <f:view beforePhase="#{itineraryChooseItineraryTypeManagedBean.initView}"/>
        <p:menubar model="#{itineraryChooseItineraryTypeManagedBean.touristMainMenuModel}"/>
    </ui:define>

    <ui:define name="nav_menu">
        <p:menu model="#{itineraryChooseItineraryTypeManagedBean.touristNavMenuModel}"/>
    </ui:define>

    <ui:define name="content">
        <h:form id="formMain">
            <p:growl id="growl" showDetail="true" />
            <br/>
            <br/>
            <p:fieldset style="position:relative; width:850px">
                <h2>#{purchaseGrouponManagerBean.selectedGroupon.groupon.name}</h2>
                <h:panelGrid columns="2" cellpadding="5" frame="above" style="text-align:center">
                    <h:panelGrid border="1" columns="1" cellpadding="5" style="top:10px; width:300px">
                        <p:commandLink title="Buy now" action="tourist/VisitorMakeGrouponOrder?faces-redirect=true">
                            <p:graphicImage value="/images/buttons/buynowbutton.jpg" /> 
                        </p:commandLink>

                        <h:outputText value="AMOUNT: $S #{purchaseGrouponManagerBean.selectedGroupon.groupon.offeredPrice}" 
                                      style="font-weight:bold; text-align:center; font-size:18px"/>
                        <h:panelGrid border="0" rules="" columns="3" cellpadding="5" style="text-align:center">
                            <h:outputText value="NORMAL PRICE" style="font-weight:bold; text-align:center; font-size:14px"/>
                            <h:outputText value="DISCOUNT" style="font-weight:bold; text-align:center; font-size:14px"/>
                            <h:outputText value="YOU SAVE" style="font-weight:bold; text-align:center; font-size:14px"/>
                            <h:outputText value="$S#{purchaseGrouponManagerBean.selectedGroupon.groupon.originalPrice}" style="font-weight:bold; text-align:center; font-size:14px"/>
                            <h:outputText value="#{purchaseGrouponManagerBean.percentDiscount}%" style="font-weight:bold; text-align:center; font-size:14px"/>
                            <h:outputText value="$S#{purchaseGrouponManagerBean.savingAmount}" style="font-weight:bold; text-align:center; font-size:14px"/>
                        </h:panelGrid>
                        <h:outputText value="#{purchaseGrouponManagerBean.selectedGroupon.quantityBought} Bought" 
                                      style="font-weight:bold; text-align:center; font-size:18px"/>

                    </h:panelGrid>

                    <h:panelGrid columns="1" cellpadding="10" style="text-align:left">
                        <p:graphicImage value="/images/upload/media/#{purchaseGrouponManagerBean.selectedGroupon.groupon.imageURL}" width="450" height="300"/>
                        <h:panelGrid border="0" columns="2" cellpadding="5" columnClasses="alignTop1; alignTop2" style="; text-align:left">              
                            <h:outputText value="Highlights" style="font-weight:bold; font-size:14px"/>
                            <h:outputText value="Fine Print" style="font-weight:bold; font-size:14px"/>
                            <h:outputText value="#{purchaseGrouponManagerBean.selectedGroupon.groupon.highlights}" escape="false" />                
                            <h:outputText value="#{purchaseGrouponManagerBean.selectedGroupon.groupon.fineprint}" escape="false" />
                        </h:panelGrid>

                    </h:panelGrid>  
                </h:panelGrid>
            </p:fieldset>
            <br/>
            <br/>
            <p:fieldset legend="Additional Information" toggleable="true" toggleSpeed="500"
                        onToggleUpdate="growl" style="width:850px">
                <h:panelGrid columns="1" cellpadding="10">
                    <h:outputText value="#{purchaseGrouponManagerBean.selectedGroupon.groupon.name}" style="font-weight:bold; text-align:center; font-size:14px"/>
                    <h:outputText value="#{purchaseGrouponManagerBean.selectedGroupon.groupon.description}" escape="false"/>
                </h:panelGrid>
            </p:fieldset>
        </h:form>
    </ui:define>
</ui:composition>